<h1>ARTICLES</h1>
<?php
$req = $bdd->query('SELECT * FROM articles ORDER BY date_creation DESC LIMIT 2');
while ($donnees = $req->fetch())
{
	$req_cat = $bdd->prepare('SELECT * FROM categories_articles WHERE id=:id');
	$req_cat->execute(array('id' => $donnees['categorie']));
	$donnees_cat = $req_cat->fetch();
	
	$calendrier=date_parse($donnees['date_creation']);
	$noms_mois=array('0','JAN','FEV','MAR','AVR','MAI','JUIN','JUIL','AOU','SEPT','OCT','NOV','DEC');
	?>
	
	
	
	<div id="date">
		<?php
		echo '<span class="jour">'.$calendrier["day"].'</span><br/>';
		$num_mois=$calendrier["month"];
		echo '<span class="mois">'.$noms_mois[$num_mois].'</span><br/>';
		echo '<span class="annee">'.$calendrier["year"].'</span><br/>';
		?>
	</div>

	<h2><?php echo stripslashes($donnees['titre']); ?></h2>
	<h3><?php echo stripslashes($donnees_cat['nom']); ?></h3>
	<p><?php echo stripslashes($donnees['introduction']); ?></p>
	<div class="menu">
		<ul><li><a href="index.php?page=articles&id=<?php echo $donnees['id'] ?>">Lire l'article</a></li></ul>
	</div>
	<div class="clear"></div>
	<?php
}
$req->closeCursor();
?>
